//
//  OilCardTableViewCell.m
//  JxCarios
//
//  Created by phev on 15/2/12.
//  Copyright (c) 2015年 xiongchuanqi. All rights reserved.
//

#import "OilCardTableViewCell.h"
#import "NSDictionary+GetData.h"
@implementation OilCardTableViewCell

- (void)awakeFromNib {
    if ([self respondsToSelector:@selector(setSeparatorInset:)]) {
        [self setSeparatorInset:UIEdgeInsetsZero];
    }
    
    if ([self respondsToSelector:@selector(setLayoutMargins:)]) {
        [self setLayoutMargins:UIEdgeInsetsZero];
    }
    
    if([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
        [self setPreservesSuperviewLayoutMargins:NO];
    }
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setInfo:(NSDictionary *)info{
    if (info) {
        _info = [info copy];
    }
    _oilCardLabel.text = [_info customObjectForkey:@"CARD_NUMBER"];
    _HolderLabel.text = [_info customObjectForkey:@"CARDHOLDER"];
}

- (IBAction)rechargeBtn:(id)sender {
    UIButton *btn = (UIButton *)sender;
    if (btn == _checkBtn) {
        _checkBtn.selected = YES;
    }
    NSDictionary *cellInfo = [NSDictionary dictionaryWithObjectsAndKeys:_info,@"info",self,@"cell",nil];
    if (_target && _action) {
        [_target performSelectorInBackground:_action withObject:cellInfo];
    }
}
@end
